package com.dream.keigezhushou.Activity.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.dream.keigezhushou.R;

/**
 *   评论列表的Adapter
 */

public class EvaluateAdapter extends BaseAdapter {

    private Context mContext;

    int c = 5;

    public EvaluateAdapter(Context context) {
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return c;
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        ViewHolder mHolder = null;
        if (view == null){

            view = LayoutInflater.from(mContext).inflate(R.layout.layout_evaluate_item,null);

            mHolder = new ViewHolder();
            mHolder.ivUserPic = (ImageView)view.findViewById(R.id.iv_user_pic);
            mHolder.tvUserNick = (TextView)view.findViewById(R.id.tv_user_nick);
            mHolder.tvDate = (TextView)view.findViewById(R.id.tv_date);
            mHolder.tvContent = (TextView)view.findViewById(R.id.tv_describe);

            view.setTag(mHolder);

        }else {

            mHolder = (ViewHolder)view.getTag();
        }


        return view;
    }


    class ViewHolder{

        ImageView ivUserPic;

        TextView tvUserNick,tvDate,tvContent;
    }
}
